#pragma once
#include "GameEngine.h"
#include <SDL_video.h>
#include <SDL_timer.h>

#include <string>

class GraphEngine
{
public:
	GraphEngine();
	~GraphEngine();    
	void refreshScreen(void);
	void redrawPlayers(void);
	void redrawMap(void);
	void setGameEngine(GameEngine g);
    static const int screenW=800;
	static const int screenH=600;
	static const int screenColor=32;
	void init();
	void wait(int time_ms);
private:
	tile *map;
	void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip);
	bool check_collision(SDL_Rect A, SDL_Rect B);
	SDL_Surface *screenSW;
	SDL_Rect camera;
	GameEngine g;
	SDL_Surface LoadImage(char* filename);
	void setCamera();
	void setFollowedPlayer(int number);
	int followedPlayer;
	unsigned int mapWidth, mapHeight;
};

